<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-block">
          <?php
          if($message == 'filed'){
          ?>
          <div class="alert alert-error fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Filed!</strong> Fail to save data.
          </div>
          <?php
          }
          if($message == 'sukses'){
          ?>
          <div class="alert alert-success fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Success!</strong> Now you have new user.
          </div>
          <?php
          }
          ?>
          <div class="widget-head">
            <h5><?=$title_table?></h5>
            <div class="widget-control pull-right">
              <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?=  site_url("outlet/add-new") ?>"><i class="icon-plus"></i> Add New</a></li>
<!--                <li><a href="#"><i class="icon-ok"></i> Active</a></li>
                <li><a href="#"><i class="icon-minus-sign"></i> No-Active</a></li>
                <li><a href="#"><i class="black-icons pdf_document"></i> Export to PDF</a></li>-->
                <li><a href="<?=  site_url("outlet/export-xls") ?>"><i class="black-icons excel_document"></i> Export to XLS</a></li>
              </ul>
            </div>
          </div>
          <div class="widget-content">
            <div class="widget-box">
              <table class="data-tbl-boxy table">
                <thead>
                  <tr>
                    <th>Name</th>
                    <th>Kota</th>
                    <th>Telp</th>
                    <th>Email</th>
                    <th>Status</th>
                    <th>Option</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  if(is_array($data)){
                    foreach ($data as $key => $value) {
                      if($value->id_status_outlet == 0)
                        $status = "<span class='label label-success'>Active</span>";
                      else
                        $status = "<span class='label label-important'>No Active</span>";
                        
                      $link_detail = site_url("outlet/detail/".$value->id_outlet);
					  $link_activity_report = site_url("outlet/tambahan/activity/".$value->id_outlet);
                      $link_dev = site_url("dev-checklist/report/".$value->id_outlet);
                      $link_stoct = site_url("product/detail-stoct/".$value->id_outlet);
                      $link_pendapatan = site_url("outlet/pendapatan-lain/pendapatan-lain-outlet/".$value->id_outlet);
                      $link_opex = site_url("outlet/opex/opex-outlet/".$value->id_outlet);
//                      $link_pic = site_url("outlet/pic-users/".$value->id_outlet);
                      print "
                  <tr>
                    <td>{$value->name}</td>
                    <td>{$value->kota}</td>
                    <td>{$value->telp}</td>
                    <td>{$value->email}</td>
                    <td>{$status}</td>
                    <td>
                      <div class='btn-group'>
                        <button data-toggle='dropdown' class='btn btn-small dropdown-toggle'>Action<span class='caret'></span></button>
                        <ul class='dropdown-menu'>
                          <li><a href='{$link_detail}'>Operation</a></li>
                          <li><a href='".site_url("outlet/tambahan/add-target/".$value->id_outlet)."'>Target Tahunan</a></li>
						  <li><a href='{$link_activity_report}'>Activity Report</a></li>
                          <li><a target='_blank' href='{$link_dev}'>Development</a></li>
                          <li><a href='{$link_stoct}'>Kartu Stock</a></li>
                          <li class='divider'></li>
                          <li><a href='{$link_opex}'>Opex</a></li>
                          <li><a href='{$link_pendapatan}'>Pendapatan Lain</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>";
                    }
                  }
                  ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>